import {Component} from "react";
import {View} from "@tarojs/components";
import '../css/munus.scss'
import MenusItem from "./menus-item";

export default class Menus extends Component {
  constructor(props) {
    super(props);
    this.state = {
      menusList: [
        {
          name: '错题本',
          key: '0',
          iconName: 'ctb',
          color: '#fcaf0e'
        },
        {
          name: '举一反三',
          key: '1',
          iconName: 'jyfs',
          color: '#e64545'
        },
        {
          name: '学情分析',
          key: '2',
          iconName: 'xqfx',
          color: '#6d71f9'
        },
        {
          name: '校园口点名',
          key: '3',
          iconName: 'xmkdm',
          color: '#1bd86c'
        },
        {
          name: '考勤差异',
          key: '4',
          iconName: 'kqcy',
          color: '#ed7a34'
        },
        {
          name: '美食分享',
          key: '5',
          iconName: 'fsfx',
          color: '#ff8940'
        },
        {
          name: '刷脸',
          key: '6',
          iconName: 'sl',
          color: '#44a5ff'
        },
        {
          name: '请假',
          key: '7',
          iconName: 'qj',
          color: '#fe9945'
        }
      ]
    }
  }
  render() {
    const { menusList } = this.state
    return (
      <View className='meunsbox'>
        {
          menusList.map((item, index) => <MenusItem item={item} key={index} />)
        }
      </View>
    )
  }
}
